package com.vueperson.vueperson.t1.CreationalPattern.PrototypePattern.PrototypeManager;




import com.vueperson.vueperson.t1.CreationalPattern.PrototypePattern.t01.ConcretePrototype;

import java.io.*;

public class ConcretePrototypeA extends Prototype {
    private String attr;

    public String getAttr() {
        return attr; //成员变量
    }

    public void setAttr(String attr) {
        this.attr = attr;
    }

    @Override
    public String toString() {
        return "ConcretePrototype{" +
                "attr='" + attr + '\'' +
                '}';
    }


    @Override
    public Prototype clone() {
        Prototype prototype = new ConcretePrototypeA();
        ((ConcretePrototypeA)prototype).setAttr(this.attr);
        return prototype;
    }

}
